package io.github.lee.jel.ui.item.list

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import io.github.lee.core.ui.adapter.DataBindingAdapter
import io.github.lee.jel.databinding.ItemItemListGridBinding
import io.github.lee.jel.domain.Item

class ItemListAdapter : DataBindingAdapter<Item, ItemItemListGridBinding>() {
    override fun onCreateDataBinding(
        context: Context,
        inflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ItemItemListGridBinding =
        ItemItemListGridBinding.inflate(inflater, parent, false)

    override fun onItemHolder(binding: ItemItemListGridBinding, item: Item) {
        binding.item = item
    }

}